<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>添加/修改页面</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="../../../component/elementUI/index.css">
    <link rel="stylesheet" href="../../../component/pear/css/pear.css"></el-input>
    <link rel="stylesheet" href="../../../style/wangeditor.css">
    <link rel="stylesheet" href="../../../style/index.css">
</head>

<body>
    <div id="app" v-cloak>
        <div class="add">
            <div class="header">
                <span>{{(action == 'Add'?'添加':'修改')}}
                    农事操作录入</span>
            </div>
            <div class="main" style="padding: 0 15px;">
                <!-- 配置属性, 目前仅支持 单主表 多子表 结构 -->
                <div id="form" :data-options="JSON.stringify({'tableName':'farm_operation_record','formName':'dataForm' ,'primaryKey':'Farm_Operation_SerialNumber'})">                  
                </div>
                <div class="table_titel">
                    <div class="titel">农事操作录入</div>
                </div>
                <el-form :model="dataForm" ref="form" :inline-message="true" style="width: 100%">
                    <el-descriptions :column="2" size="large" border>        
                        <el-descriptions-item>
                            <template slot="label">
                                <div class="cell-item required">地块编号</div>
                            </template>
                            <el-form-item prop="Land_SerialNumber" 
                                :rules="[{ required: true, message: '请选择地块编号', trigger: 'change' }]">
                                <el-select v-model.trim="dataForm.Land_SerialNumber" placeholder="请选择地块编号" 
                                style="width: 100%;" clearable filterable>
                                    <el-option v-for="(item,index) in land_info" :key="index" :label="item.Land_Name" :value="item.Land_SerialNumber" />
                                </el-select>
                            </el-form-item>
                        </el-descriptions-item>
                        <el-descriptions-item>
                            <template slot="label">
                                <div class="cell-item required">操作图片</div>
                            </template>
                            <el-form-item prop="Operation_Photo">
                                <yl-upload v-model="dataForm.Operation_Photo"></yl-upload>
                            </el-form-item>
                        </el-descriptions-item>
                        <el-descriptions-item>
                            <template slot="label">
                                <div class="cell-item required">作物</div>
                            </template>
                            <el-form-item prop="Crop_SerialNumber" :rules="[{ required: true, message: '请选择作物', trigger: 'change' }]">
                                <el-select v-model.trim="dataForm.Crop_SerialNumber" placeholder="请选择作物" style="width: 100%;" clearable filterable>
                                    <el-option v-for="(item,index) in crop" :key="index" :label="item.Crop_Name" :value="item.Crop_SerialNumber" />
                                </el-select>
                            </el-form-item>
                        </el-descriptions-item>
                        <el-descriptions-item>
                            <template slot="label">
                                <div class="cell-item required">操作人</div>
                            </template>
                            <el-form-item prop="Planting_People_SerialNumber" :rules="[{ required: true, message: '请选择操作人', trigger: 'change' }]">
                                <el-select v-model.trim="dataForm.Planting_People_SerialNumber" placeholder="请选择操作人" style="width: 100%;" clearable filterable>
                                    <el-option v-for="(item,index) in planting_people" :key="index" :label="item.Planting_People_Name" :value="item.Planting_People_SerialNumber" />
                                </el-select>
                            </el-form-item>
                        </el-descriptions-item>
                       <el-descriptions-item>
                            <template slot="label">
                                <div class="cell-item">操作类型</div>
                            </template>
                            <el-form-item prop="Operation_Type"
                                :rules="[{ required: true, message: '请选择操作类型', trigger: 'change' }]">
                                <el-select v-model.trim="dataForm.Operation_Type" placeholder="请选择操作类型" style="width: 100%;" clearable filterable>
                                    <el-option v-for="(item,index) in Operation_Type" :key="index" :label="item.name" :value="item.name" />
                                </el-select>
                            </el-form-item>
                        </el-descriptions-item>    
                                            
                        <el-descriptions-item>
                            <template slot="label">
                                <div class="cell-item">操作日期</div>
                            </template>
                            <el-form-item prop="Operation_Date"
                                :rules="[{ required: true, message: '请输入操作日期', trigger: 'change' }]">
                                    <el-date-picker @change="handleDate($event,item)" v-model.trim="dataForm.Operation_Date"
                                    format="yyyy-MM-dd" style="width: 100%;" value-format="yyyy-MM-dd" type="date"
                                    placeholder="可选择操作日期" size="large"></el-date-picker>
                            </el-form-item>
                        </el-descriptions-item>                       
                        <el-descriptions-item>
                            <template slot="label">
                                <div class="cell-item">生育期</div>
                            </template>
                            <el-form-item prop="Growth_Stage"
                                :rules="[{ required: true, message: '请选择生育期', trigger: 'change' }]">
                                 <el-select v-model.trim="dataForm.Growth_Stage" placeholder="请选择生育期" style="width: 100%;" clearable filterable>
                                    <el-option v-for="(item,index) in growth_stage" :key="index" :label="item.name" :value="item.name" />
                                </el-select>
                            </el-form-item>
                        </el-descriptions-item>
                        
                        <el-descriptions-item>
                            <template slot="label">
                                <div class="cell-item">农资名称</div>
                            </template>
                            <el-form-item prop="Material_Name"
                                :rules="[{ required: true, message: '请输入农资名称', trigger: 'blur' }]">
                                <el-input v-model.trim="dataForm.Material_Name"
                                    placeholder="请输入农资名称"></el-input>
                            </el-form-item>
                        </el-descriptions-item>   
                        <el-descriptions-item>
                            <template slot="label">
                                <div class="cell-item">农资用量</div>
                            </template>
                            <el-form-item prop="Material_Dosage"
                                :rules="[{ required: true, message: '请输入农资用量', trigger: 'blur' }]">
                                <el-input v-model.trim="dataForm.Material_Dosage"
                                    placeholder="请输入农资用量"></el-input>
                            </el-form-item>
                        </el-descriptions-item>   
                        <el-descriptions-item>
                            <template slot="label">
                                <div class="cell-item">用量单位</div>
                            </template>
                            <el-form-item prop="Dosage_Unit"
                                :rules="[{ required: true, message: '请输入用量单位', trigger: 'blur' }]">
                                <el-input v-model.trim="dataForm.Dosage_Unit"
                                    placeholder="请输入用量单位"></el-input>
                            </el-form-item>
                        </el-descriptions-item>                          
                    </el-descriptions>
                </el-form>               
            </div>
            <div class="footer">
                <el-button size="medium" @click="handleBack">返回</el-button>
                <el-button size="medium" type="primary" plain @click="handleSubmit" :loading="loading">提交</el-button>
            </div>
        </div>
    </div>
    <script type="text/javascript" src="../../../utils/wangeditor.js"></script>
    <script type="text/javascript" src="../../../utils/xlsx.full.min.js"></script>
    <script type="text/javascript" src="../../../utils/jquery.min.js"></script>
    <script type="text/javascript" src="../../../utils/jquery.cookie.js"></script>
    <script type="text/javascript" src="../../../utils/vue.min.js"></script>
    <script type="text/javascript" src="../../../utils/vuex.min.js"></script>
    <script type="text/javascript" src="../../../component/elementUI/index.js"></script>
    <script type="text/javascript" src="../../../utils/components.js"></script>
    <script type="text/javascript" src="../../../utils/compressor.js"></script>
    <script type="text/javascript" src="../../../utils/validity.js"></script>
    <script type="text/javascript" src="../../../utils/utils.js"></script>
    <script type="text/javascript" src="../../../utils/http.js"></script>
    <script type="text/javascript" src="js/add.js"></script>
</body>
        
</html>